﻿//using Abp.Authorization;
using Cjj.Exam.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Authorization.Permissions;

namespace Cjj.Exam.Permissions;

public class ExamPermissionDefinitionProvider : PermissionDefinitionProvider
{
    public override void Define(IPermissionDefinitionContext context)
    {
        var myGroup = context.AddGroup(ExamPermissions.GroupName);
        //Define your own permissions here. Example:
        myGroup.AddPermission(ExamPermissions.CjjBook.Default, L("Exam:Books"));
        myGroup.AddPermission(ExamPermissions.CjjBook.Create, L("Exam:Books.Create"));
        myGroup.AddPermission(ExamPermissions.CjjBook.Edit, L("Exam:Books.Edit"));
        myGroup.AddPermission(ExamPermissions.CjjBook.Delete, L("Exam:Books.Delete"));
    }

    private static LocalizableString L(string name)
    {
        return LocalizableString.Create<ExamResource>(name);
    }
}
